const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = {
    mode: 'development',
    entry: './app.js',
    output: {
        publicPath: '/'
    },
    devServer: {
        static: path.resolve(__dirname, './dist'),
        // 增加一个压缩头部
        compress: false,
        port: 3000,
        // 配置头部信息
        headers: {
            'X-Access-Token': 'I love you forever!'
        },
        proxy: {
            '/api': 'http://localhost:9000'
        },
        // 将本地服务http变成https
        // https: true
        http2: true,
        historyApiFallback: true,
        host: '0.0.0.0'
    },
    plugins: [
        new HtmlWebpackPlugin()
    ]
}